﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1.ConfigCmd
{
    public partial class FormDelDoor_AuthCard : Form
    {
        private string devId;
        private string monitorId;
        private string monitorId_Name;

        public FormDelDoor_AuthCard(string deviceId, string MonitorDev_Id, string monitorDevId_Name)
        {
            InitializeComponent();

            devId = deviceId;
            monitorId = MonitorDev_Id;
            monitorId_Name = monitorDevId_Name;
        }

        private void button_enter_Click(object sender, EventArgs e)
        {
            if (ConfigCmd.configCommand.instance.DeleteDoor_AuthCard(devId, monitorId))
            {
                UserLog.adduseroperlog(User.UserID, User.Username, "门卡删除", "成功", monitorId_Name, devId, "删除所有授权");
                MessageBox.Show("已进入发送队列！", "", MessageBoxButtons.OK, MessageBoxIcon.Information);

                this.Dispose();
            }
            else
            {
                UserLog.adduseroperlog(User.UserID, User.Username, "门卡删除", "失败", monitorId_Name, devId, "删除所有授权");
                MessageBox.Show("发送失败!", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

        private void button_cancle_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void FormDelDoor_AuthCard_Load(object sender, EventArgs e)
        {
            this.textBox1.Text = devId.ToString();
        }
    }
}
